@extends('desktop.template.bootstrap')

@section('scripts')
<link rel="stylesheet" href="{{asset('css/public-index.css')}}" />
@endsection

@section('header')
@include('desktop.template.navbar-complete')
@endsection

@section('content')
<section class="books" style="padding-top: 40px;">
	<div class="container">
		@foreach($datas as $data)
		<!-- {{ $data['category']->name }} -->
		<div class="pane-title">
			<div class="row">
				<div class="col-xs-6">
					<h3 class="title">{{ $data['category']->name }}</h3>
				</div>
				<div class="col-xs-6 text-right info" style="padding-top: 10px;">
					<a href="{{ url('/categories/'.$data['category']->order) }}">更多&gt;</a>
				</div>
			</div>
		</div>
		<div class="row">
			@foreach($data['books'] as $book)
			<div class="col-xs-4">
				<a class="book" href="{{ url('/books/'.$book->id) }}">
					<div class="media">
						<div class="media-left">
							<img class="book-thumbnail" src="{{ $book->thumbnailUrl() }}" alt="" />
						</div>
						<div class="media-body">
							<h4 class="title dotdotdot-nowrap">{{ $book->name }}</h4>
							<div class="desc">
								{!! str_limit(strip_tags($book->abstract), 200) !!}
							</div>
							<div class="info">
								<div class="author">
									<span class="fa fa-fw fa-user-circle-o"></span>
									{{ $book->author }}
								</div>
								<div class="labels">
									<span class="label label-default">{{ $book->font_num }}</span>
									<span class="label label-danger">{{ floor($book->clicks/10000) }}万点击</span>
								</div>
							</div>
						</div>
					</div>
				</a>
			</div>
			@endforeach
		</div>
		@endforeach
	</div>
</section>
@endsection
@section('links')
<div class="container">
	<ul class="friend-link">
		<li>友情链接：</li>
		@foreach($links as $link)
		<li><a href="{{ $link->link }}" target="_new">{{ $link->name }}</a></li>
		@endforeach
	</ul>
</div>
@endsection